<?php

namespace Mcm\RepasBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Bon
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Mcm\RepasBundle\Entity\BonRepository")
 */
class Bon
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\Column(name="code", type="integer")
     */
    private $code;

    /**
     * @var string
     *
     * @ORM\Column(name="png", type="string")
     */
    private $png;
    /**
     * @var float
     *
     * @ORM\Column(name="montant", type="float")
     */
    private $montant;
    
   /**
   * @ORM\ManyToOne(targetEntity="Mcm\RepasBundle\Entity\Enseigne")
   * @ORM\JoinColumn(nullable=false)
   */
    private $enseigne;

    /**
   * @ORM\ManyToOne(targetEntity="Mcm\UserBundle\Entity\User", inversedBy="bons")
   * @ORM\JoinColumn(nullable=false)
   */
  private $hote;
  
  /**
   * 
   * @return Mcm\RepasBundle\Entity\Enseigne 
   */
  public function getEnseigne() {
      return $this->enseigne;
  }


  /**
   * 
   * @param Mcm\RepasBundle\Entity\Enseigne $enseigne
   */
  public function setEnseigne($enseigne) {
      $this->enseigne = $enseigne;
  }
  /**
   * 
   * @return Mcm\UserBundle\Entity\User
   */
  public function getHote() {
      return $this->hote;
  }
  /**
   * 
   * @param Mcm\UserBundle\Entity\User $hote
   */
  public function setHote($hote) {
      $this->hote = $hote;
  }

  public function getPng() {
      return $this->png;
  }

  public function setPng($png) {
      $this->png = $png;
  }
  
  public function getPath(){
      return '/MCM/web/codebarre/'.$this->code.'.png';
  }

  public function getUploadDir(){
     return __DIR__.'/../../../../web/codebarre/'.$this->code.'.png';
          
  }  
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set code
     *
     * @param integer $code
     * @return Bon
     */
    public function setCode($code)
    {
        $this->code = $code;
    
        return $this;
    }

    /**
     * Get code
     *
     * @return integer 
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * Set montant
     *
     * @param float $montant
     * @return Bon
     */
    public function setMontant($montant)
    {
        $this->montant = $montant;
    
        return $this;
    }

    /**
     * Get montant
     *
     * @return float 
     */
    public function getMontant()
    {
        return $this->montant;
    }
}
